#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	getline(cin, s);
	int n;
	char ch;
	cin>>n>>ch;
	for(int i = 0;i < s.size();i++)
	{
		if(i+1 == n)
			cout<<ch;
		cout<<s[i];
	}
	if(n > s.size())
		cout<<ch;
	return 0;
}

